<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<title>时间选择器</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css"/>
		<link rel="stylesheet" href="../lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
		<script src="../lib/jquery.mobile-1.4.5/jquery.min.js"></script>
		<script src="../lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
		<script type="text/javascript" src="../script/api.js"></script>
		<script src="../lib/config.js"></script>
		<script src="../lib/common.js"></script>
		<style>
			header {
				background-color: rgb(90,153,222);
				border-bottom: 1px solid #f2f2f2;
			}
		</style>
	</head>
	<body>
		<header id='header'>
			<div class="header" style="height:32px;">
				<div style="float: left;margin:10px 10px;width:35%;">
					<a onclick="api.closeWin();"> <img src="../image/navbtn_back.png" style="height:24px;"/> </a>
				</div>
				<div style="float:left;margin:12px 0px;color:rgb(255,255,255);font-size: 18px;">
					<span id='title'>选择时间</span>
				</div>
				<div style="float: right;margin:10px 10px;">
					<a id='btnOK' style="color:rgb(255,255,255);font-size: 18px;"> 确定 </a>
				</div>
			</div>
			<div style="clear: both;"></div>
		</header>
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript">
		var timeStr = '';
		apiready = function() {
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				api.closeWin();
			});
			var obj = api.require('timeSelector');
			obj.open({
				bgColor : 'rgba(255, 255, 255,0.8)'
			}, function(ret, err) {
				if (ret) {
					timeStr = getFormatTime(ret.hour, ret.minute, 0);
				}
			});
		};
		$("#btnOK").click(function() {
			if (timeStr == '') {
				api.closeWin();
				return;
			}
			api.sendEvent({
				name : 'timeInputed',
				extra : {
					key1 : timeStr,
					key2 : 'value2'
				}
			});
			api.closeWin();
		});
	</script>
</html>